<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <p>第三次提交</p>
    <title>随机颜色按钮</title>
    <style>
        #text {
            font-size: 24px;
        }
    </style>
</head>
<body>
    <p id="text">点击按钮改变文字颜色</p>
    <button onclick="changeColor()">点击我</button>

    <script>
        function changeColor() {
            document.getElementById("text").style.color = getRandomColor();
        }

        function getRandomColor() {
            const letters = '0123456789ABCDEF';
            let color = '#';
            for (let i = 0; i < 6; i++) {
                color += letters[Math.floor(Math.random() * 16)];
            }
            return color;
        }
    </script>
</body>
</html>
